package com.javabean;

/*
 *      用户类
 *          手机号 phoneNumber
 *          姓名 name
 *          身份证号码 IDNo
 *          登录名 userName
 *          地址 address
 *
 * */

//注意类名必须跟文件名一致,不能与java中的API中的类名一致,大驼峰
public class User {
    //1.成员变量 -> 必须私有
    private String phoneNumber;
    private String name;
    private String IDNo;
    private String userName;
    private String address;


    //2.构造方法必须两种都提供

    //无参构造
    public User() {
    }

    //带参构造

    public User(String phoneNumber, String name, String IDNo, String userName, String address) {
        this.phoneNumber = phoneNumber;
        this.name = name;
        this.IDNo = IDNo;
        this.userName = userName;
        this.address = address;
    }

    //3.get和set方法

    public String getPhoneNumber() {
        return phoneNumber;
    }

    public void setPhoneNumber(String phoneNumber) {
        this.phoneNumber = phoneNumber;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getIDNo() {
        return IDNo;
    }

    public void setIDNo(String IDNo) {
        this.IDNo = IDNo;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    //成员方法show()
    //用于展示属性
    public void show(){
        /*        用户类
         *          手机号 phoneNumber
         *          姓名 name
         *          身份证号码 IDNo
         *          登录名 userName
         *          地址 address*/
        System.out.println("手机号: " + phoneNumber);
        System.out.println("姓名: " + name);
        System.out.println("身份证号码: " + IDNo);
        System.out.println("登录名: " + userName);
        System.out.println("地址: " + address);
    }
}
